﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Hartley.ApplicationLogic;
using Hartley.DTOs;
namespace WebApplication1
{
    public partial class AddNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnNewsAdd_Click(object sender, EventArgs e)
        {
            NewsItemDTO newsItemDTO = new NewsItemDTO { NewsId = Guid.NewGuid(), Title = txtNewsTitle.Text, Description = txtNewsDescription.Text, Type = ddlNewsType.SelectedValue, Visible = chkNewsIsVisible.Checked, ModifiedTime = DateTime.Now };
            AdminAL adminAL = new AdminAL();
            adminAL.saveNews(newsItemDTO);
        }

        protected void btnNewsAdd_Click1(object sender, EventArgs e)
        {
            NewsItemDTO newsItem = new NewsItemDTO
            {
                NewsId = Guid.NewGuid(),
                Title=txtNewsTitle.Text,
                Description = txtNewsDescription.Text,
                Type = ddlNewsType.SelectedValue,
                Visible = chkNewsIsVisible.Checked,
                //CreatedBy="Tharsan",
                CreatedTime=System.DateTime.Now,
                //ModifiedBy = "Tharsan",
                ModifiedTime = System.DateTime.Now
            };
            AdminAL adminAL = new AdminAL();
            adminAL.saveNews(newsItem);

        }

       
    }
}
